<%@ page import="com.fs.common.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: suke
  Date: 2023/10/23
  Time: 9:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<!-- 网页使用的语言 -->
<html lang="zh-CN">
<head>
    <!-- 指定字符集 -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>修改用户</title>

    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <script src="../js/jquery-2.1.0.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>

</head>
<body>
<%
    User user = (User)request.getAttribute("user");
    String id="";
    String name="";
    String sex="";
    String age="";
    String address="";
    String qq="";
    String email="";
    if(user != null){
        id = user.getId().toString();
        name = user.getName();
        sex = user.getGender();
        age = user.getAge().toString();
        address = user.getAddress();
        qq = user.getQq();
        email = user.getEmail();
    }
%>
<div class="container" style="width: 400px;">
    <h3 style="text-align: center;">修改联系人</h3>
    <form action="/UpdateUserSubmitServlet" method="post">
        <input type="hidden" name="id"  value="<%=id%>" />
        <div class="form-group">
            <label for="name">姓名：</label>
            <input type="text"  class="form-control" id="name" name="name" value="<%=name%>"  readonly="readonly" placeholder="请输入姓名" />
        </div>

        <div class="form-group">
            <label>性别：</label>
            <%
                if(sex.equals("男")){
            %>
                <input type="radio" name="sex" value="男" checked  />男
            <%}else{%>
               <input type="radio" name="sex" value="男" />男
            <%}%>
            <%
                if(sex.equals("女")){
            %>
                <input type="radio" name="sex" value="女" checked />女
            <%}else{%>
                <input type="radio" name="sex" value="女"  />女
            <%}%>
        </div>

        <div class="form-group">
            <label for="age">年龄：</label>
            <input type="text" class="form-control" id="age"   value="<%=age%>" name="age" placeholder="请输入年龄" />
        </div>

        <div class="form-group">
            <label for="address">籍贯：</label>
            <select name="address" id="address" class="form-control" >
                <%
                    if(address.equals("湖北")){
                %>
                     <option value="湖北" selected>湖北</option>
                <%}else{%>
                     <option value="湖北" >湖北</option>
                <%}%>

                <%
                    if(address.equals("北京")){
                %>
                    <option value="北京" selected>北京</option>
                <%}else{%>
                    <option value="北京" >北京</option>
                <%}%>

                <%
                    if(address.equals("上海")){
                %>
                    <option value="上海" selected>上海</option>
                <%}else{%>
                    <option value="上海" >上海</option>
                <%}%>

                <%
                    if(address.equals("湖南")){
                %>
                    <option value="湖南" selected>湖南</option>
                <%}else{%>
                    <option value="湖南" >湖南</option>
                <%}%>
            </select>
        </div>

        <div class="form-group">
            <label for="qq">QQ：</label>
            <input type="text" id="qq" class="form-control" name="qq"  value="<%=qq%>" placeholder="请输入QQ号码"/>
        </div>

        <div class="form-group">
            <label for="email">Email：</label>
            <input type="text" id="email" class="form-control" value="<%=email%>" name="email" placeholder="请输入邮箱地址"/>
        </div>

        <div class="form-group" style="text-align: center">
            <input class="btn btn-primary" type="submit" value="提交" />
            <input class="btn btn-default" type="reset" value="重置" />
            <input class="btn btn-default" type="button" value="返回"/>
        </div>
    </form>
</div>
</body>
</html>
